﻿// todo: add & remove partnerships from here too
// todo: partnership behaviour details (overwrite, delete etc.)

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ESJImporter
{
    public partial class Partnerships : Form
    {
        private ArrayList array_DisplayedPartnerships;

        public Partnerships(ref ArrayList partnershiplist)
        {
            InitializeComponent();

            array_DisplayedPartnerships = partnershiplist;
        }

        private void updateListView()
        {
            listview_PartnershipsOverview.Items.Clear();

            foreach (PartnerShip ps in array_DisplayedPartnerships)
            {
                ListViewItem lvi = listview_PartnershipsOverview.Items.Add(ps.str_ESJFile,ps.str_ESJName,-1);
                lvi.SubItems.Add(ps.str_ESJFile);
                lvi.SubItems.Add(OneNoteFunctions.GetFullName(ps.str_ONEID));
                if (ps.date_LastSync.Year <2000)
                    lvi.SubItems.Add("never");
                else
                    lvi.SubItems.Add(ps.date_LastSync.ToShortDateString() + " " + ps.date_LastSync.ToShortTimeString());
            }
        }

        private void Partnerships_Load(object sender, EventArgs e)
        {
            updateListView();
        }

        private void bt_AddFolder_Click(object sender, EventArgs e)
        {

        }

        private void bt_RemoveFolder_Click(object sender, EventArgs e)
        {

        }
    }
}
